<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <!-- Meta, title, CSS, favicons, etc. -->
  <meta charset="utf-8">
  <title>CMS内容管理系统</title>
  <meta name="keywords" content="Admin">
  <meta name="description" content="Admin">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <!-- Core CSS  -->
  <link rel="stylesheet" type="text/css" href="css/bootstrap.css">
  <link rel="stylesheet" type="text/css" href="css/glyphicons.min.css">

  <!-- Theme CSS -->
  <link rel="stylesheet" type="text/css" href="css/theme.css">
  <link rel="stylesheet" type="text/css" href="css/search.css">
  <link rel="stylesheet" type="text/css" href="css/pages.css">
  <link rel="stylesheet" type="text/css" href="css/plugins.css">
  <link rel="stylesheet" type="text/css" href="css/responsive.css">

  <!-- Boxed-Layout CSS -->
  <link rel="stylesheet" type="text/css" href="css/boxed.css">

  <!-- Demonstration CSS -->
  <link rel="stylesheet" type="text/css" href="css/demo.css">

  <!-- Your Custom CSS -->
  <link rel="stylesheet" type="text/css" href="css/custom.css">
  <link rel="stylesheet" type="text/css" href="../include/page/css.css">
  
  <!-- Core Javascript - via CDN --> 
  <script type="text/javascript" src="js/jquery.min.js"></script> 
  <script type="text/javascript" src="js/jquery-ui.min.js"></script> 
  <script type="text/javascript" src="js/bootstrap.min.js"></script> 
  <script type="text/javascript" src="js/uniform.min.js"></script> 
  <script type="text/javascript" src="js/main.js"></script>
  <script type="text/javascript" src="js/custom.js"></script> 
</head>

<body>
<!-- Start: Header -->
<?php include 'header.php'; ?>
<!-- End: Header -->

<!-- Start: Main -->
<div id="main"> 
    <!-- Start: Sidebar -->
  <?php include 'aside.php' ?>
  <!-- End: Sidebar -->   

  <!-- Start: Content -->
  <section id="content">
    <div id="topbar" class="affix">
      <ol class="breadcrumb">
        <li><a href="#"><span class="glyphicon glyphicon-home"></span></a></li>
        <li class="active">管理员列表</li>
      </ol>
    </div>
    <div class="container">

	 <div class="row">
        <div class="col-md-12">
			<div class="panel">
                <div class="panel-heading">
                  <div class="panel-title">管理员列表</div>
                  <a href="admin_add.php" class="btn btn-info btn-gradient pull-right"><span class="glyphicons glyphicon-plus"></span> 添加管理员</a>
                </div>
                <form action="" method="post">
                <div class="panel-body">
                  <table class="table table-striped table-bordered table-hover dataTable">
                    
                      <tr class="active">
                        <th class="text-center" width="100"><input type="checkbox" value="" id="checkall" class=""> 全选</th>
                        <th>账号</th>
                        <th>添加时间</th>
                        <th>管理员状态是否可用</th>
                        <th width="200">操作</th>
                      </tr>
                      <?php foreach ($admin as $key => $value) {?>
                      <tr class="success">
                        <td class="text-center"><input type="checkbox" value="<?php echo $value['admin_id']; ?>" name="idarr[]" class="cbox"></td>
                        <td><?php echo $value['admin_name']; ?></td>
                        <td><?php echo date('Y-m-d h:s:s',$value['admin_addtime']); ?></td>
                        <td>
                          <a id="<?php echo $value['admin_id'] ?>" href="javascript:;" class="status btn btn-default btn-gradient">
                          <?php  
                            if($value['admin_status']==1){
                              echo '是'.'</a>';
                              }else{
                              echo '否'.'</a>';
                            }?>
                        </td>
                        <td>
                          <div class="btn-group">
                            <a  href="admin_edit.php?id=<?php echo $value['admin_id']; ?>" class="btn btn-default btn-gradient"><span class="glyphicons glyphicon-pencil"></span></a>
                            <?php 
                              $str='';
                              if ($adminId==1) {
                              $str.='<a onclick="return confirm('."'确定要删除吗？'".');" href="admin_del.php?del='.$value['admin_id'].'" class="btn btn-default btn-gradient dropdown-toggle"><span class="glyphicons glyphicon-trash"></span></a>';
                              echo $str;
                              }
                             ?>
                          </div>
                        
                        </td>
                      </tr>
                      <?php } ?>
                  </table>
                  <script type="text/javascript">
                  $('.status').click(function(){
                    var t = $(this);
                    $.get("../check.php", { uid: $(this).attr('id') },
                        function(data){
                          if(data == 1){
                            if(t.html()=='是'){
                              t.html('否');
                            }else{
                              t.html('是');
                            }
                          }
                        });
                  });
                  </script>
                  <div class="pull-left">
                  	<button type="submit" class="btn btn-default btn-gradient pull-right delall"><span class="glyphicons glyphicon-trash"></span></button>
                  </div>
                  
                  <div class="pull-right">
                    <?php echo $page_link; ?>
                  </div>
                  
                </div>
                </form>
              </div>
          </div>
        </div>
    </div>
  </section>
  <!-- End: Content --> 
</div>
<!-- End: Main --> 
</body>
</html>